import requests
import re
import random
# class Province_city():
#     def get_province(self):
#         re1=requests.request(method='get',
#                              url="http://www.webxml.com.cn/WebServices/WeatherWebService.asmx/getSupportProvince")
#         value=re1.text
#         self.province=re.findall("<string>(.*)</string>",value)[random.randint(0,35)]
#         print(self.province)
#     def get_city(self):
#         re2=requests.request(method="post",
#                              url="http://www.webxml.com.cn/WebServices/WeatherWebService.asmx/getSupportCity",
#                              headers={"Content-Type":"application/x-www-form-urlencoded"},
#                              data={"byProvinceName":self.province})
#         value1=re2.text
#         city=re.findall('<string>(.*)</string>',value1)
#
#         print(city)
# if __name__ == '__main__':
#     p=Province_city()
#     p.get_province()
#     p.get_city()



# class Yshop():
#     def get_uuid(self):
#         re1=requests.request(method="get",
#                              url="http://manage.duoceshi.com/auth/code")
#         value=re1.json()
#         self.uuid=value["uuid"]
#     def login(self):
#         re2=requests.request(method="post",
#                              url="http://manage.duoceshi.com/auth/login",
#                              headers={"Content-Type":"application/json"},
#                              json={"username":"admin",
#                                    "password":"hxls8SvnP57IDavv6E/OC/CMjC5IyLHAvEKSj8WCP7sv8wnFXRck3g2OQ2ExVw6N0ndPknbRn3q0qQEyntD61Q==",
#                                    "code":"8888",
#                                    "uuid":self.uuid})
#         value2=re2.json()
#         self.token=value2["token"]
#     def shop_group(self):
#         re3=requests.request(method="get",
#                              url="http://manage.duoceshi.com/api/yxStoreCategory?page=0&size=10&sort=sort%2Cdesc",
#                              headers={"Authorization":self.token})
#         print(re3.json())
# if __name__ == '__main__':
#     q=Yshop()
#     q.get_uuid()
#     q.login()
#     q.shop_group()